home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 54.asm < prev    next >
Assembly Source File  |  1999-09-06  |  1KB  |  66 lines

  1. * 54.asm  TLprogress     version 0.01     8.6.99
  2.  
  3.  
  4.  include 'Front.i'
  5.  
  6.  
  7. prog: ds.l 1                ;keeps progress
  8.  
  9.  
  10. strings: dc.b 0
  11. st_1: dc.b 'TLProgress demonstration',0 ;1
  12.  dc.b 'Error: out of chip memory',0 ;2
  13.  dc.b 'Wait until I''m full',0 ;3
  14.  dc.b 'Click to clear      ',0 ;4
  15.  dc.b 'Click to quit       ',0 ;5
  16.  
  17.  ds.w 0
  18.  
  19.  
  20. * demonstrate TLprogress
  21. Program:
  22.  TLwindow #0,#0,#0,#100,#100,#500,#200,#0,#st_1
  23.  beq Pr_bad
  24.  
  25.  TLstring #3,#2,#1          ;print 'wait until full'
  26.  
  27.  move.l #10,xxp_prgd+4(a4)  ;thermometer ypos   (xpos set at Pr_wait+1,3)
  28.  move.l #100,xxp_prgd+8(a4) ;            width
  29.  move.l #10,xxp_prgd+12(a4) ;            height
  30.  
  31.  clr.l prog
  32.  
  33. Pr_wait:                    ;report progress
  34.  move.l #20,xxp_prgd(a4)
  35.  TLprogress prog,#50        ;draw thermometer without text
  36.  
  37.  move.l #130,xxp_prgd(a4)
  38.  TLprogress prog,#50,txt    ;draw thermometer with text
  39.  
  40.  move.l #240,xxp_prgd(a4)
  41.  TLprogress prog,#50,%      ;draw thermometer with %
  42.  
  43.  TLbusy
  44.  
  45.  moveq #4,d7                ;d7 = delay factor (make d7 bigger for slower)
  46.  move.l xxp_gfxb(a4),a6
  47. Pr_paus:
  48.  jsr _LVOWaitTOF(a6)
  49.  dbra d7,Pr_paus
  50.  
  51.  addq.l #1,prog             ;bump total while prog < 51
  52.  cmpi.l #51,prog
  53.  bne Pr_wait
  54.  
  55.  TLunbusy
  56.  
  57.  TLstring #4,#2,#1          ;wait for acknowledge & quit ok
  58.  TLkeyboard
  59.  bra.s Pr_quit
  60.  
  61. Pr_bad:                     ;here if out of mem
  62.  TLbad #2
  63.  
  64. Pr_quit:
  65.  rts
  66.